/*
 * Copyright 2021 MindMotion Microelectronics Co., Ltd.
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include "board_init.h"


extern RTC_Time_Type rtc_time;
/*
 * Functions.
 */
int main(void)
{
    uint8_t ch;

    BOARD_Init();

    printf("hello, world\r\n");

    while (1)
    {
        ch = getchar();
        switch(ch)
        {
            case 'a':  /* Initialize RTC. */
                BSP_RTC_Init();
            break;

            case 't':  /* Get current clock time. */
				BSP_RTC_GetTime();
				printf("%04d",     rtc_time.Years);
				printf("-%02d",    rtc_time.Months);
				printf("-%02d",    rtc_time.Days);
				printf(" %02d",    rtc_time.Hours);
				printf(":%02d",    rtc_time.Mins);
				printf(":%02d\r\n",rtc_time.Secs);
				
            break;

            default:  
            break;
        }
        
    }
}

/* EOF. */

